<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>公告详情</title>
    <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport" />
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta content="telephone=no" name="format-detection" />

    <link rel="stylesheet" href="css/demo.css" />
    <script src="js/ydui.flexible.js"></script>
</head>

<body>
    <section class="g-flexview" id="app" v-cloak>
        <sync-loader v-if="loading" :color="color"></sync-loader>
        <section class="g-scrollview" v-if="!loading">
            <div class="m-cell demo-small-pitch">
                <div class="help_details">
                    <div class="header">
                        <h3>{{details.noticeTitle}}</h3>
                        <p class="time_ico"><i class="icon-time"></i>{{details.optTime}}</p>
                    </div>

                    <div class="g_content" v-html="details.noticeContent"></div>
                </div>
            </div>
        </section>

    </section>
    <script src="js/jquery.min.js"></script>
    <script src="js/vue.min.js"></script>
    <script src="js/vue-resource.js"></script>
    <script src="js/vue-spinner-master/dist/vue-spinner.js"></script>
    <script src="js/layer/layer.js"></script>
</body>
<script>
    var c_common = function() {
            /* 实例化对象 */
            var common_ = new c_common();
            /*时间格式转换*/
            c_common.prototype.formatDateTime = function(inputTime, day) {
                var date = new Date(inputTime);
                var y = date.getFullYear();
                var m = date.getMonth() + 1;
                m = m < 10 ? ('0' + m) : m;
                var d = date.getDate();
                d = d < 10 ? ('0' + d) : d;
                return day == "yes" ? y + '-' + m + '-' + (d) : y + '-' + m + '-' +
                    d;
            };
        }
        /* 获取头部信息 */
    function GetQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) {
            return r[2];
        }
    };
    var SyncLoader = VueSpinner.SyncLoader
    var app = new Vue({
        el: '#app',
        components: {
            'SyncLoader': SyncLoader
        },
        data: {
            userRole: GetQueryString('userRole'),
            rowId: GetQueryString('rowId'),
            token: GetQueryString('token'),
            details: [],
            loading: true,
            color: '#FF6C00',
        },
        methods: {
            get: function() {
                this.$http({
                    method: "post",
                    url: "/appPubgBaseAffiche/baseAfficheDetail",
                    data: {
                        token: this.token,
                        rowId: this.rowId,
                    },
                    emulateJSON: true
                }).then(function(res) { // 访问成功后执行
                    this.loading = false;
                    // layer.msg(res.data.message);
                    console.log(res);
                    this.details = res.data.data;


                }, function(error) { // 访问失败执行
                    console.log(error);
                    layer.msg('接口返回失败');
                    this.loading = false;
                })
            },
            applyJoin: function() {
                layer.msg('加入成功');
            }
        },
        filters: {
            timeSlice: function(val) {
                if (val != undefined) {
                    return val.slice(0, 19);
                }
            }
        },
        mounted: function() {
            this.$nextTick(function() {
                this.get();
            })
        }
    })
</script>

</html>